gulp       = require 'gulp'
paths      = require('../config.coffee').paths
ngTemplate = require 'gulp-angular-templatecache'
rev        = require 'gulp-rev'

gulp.task 'assets', ->
    gulp.src paths.assets[0]
        .pipe gulp.dest(paths.dest)

    gulp.src paths.assets[1]
    .pipe ngTemplate {root: 'templates/', standalone: true}
    .pipe gulp.dest paths.dest

gulp.task 'assets-optimize', ->
    gulp.src paths.assets[0]
        .pipe gulp.dest(paths.dest)

    gulp.src paths.assets[1]
    .pipe ngTemplate {root: 'templates/', standalone: true}
    .pipe rev()
    .pipe gulp.dest paths.dest
    .pipe rev.manifest()
    .pipe(gulp.dest('rev/template'))
